<template>
  <div class="main-container">
    <div class="main-header">
      <router-link to="/category">
        <img src="../../assets/icon/icon-mi.png" alt="" class="img-logo" />
      </router-link>

      <router-link to="/search/list">
        <div class="search-box">
          <i class="iconfont icon-search"></i>
          <span>搜索商品名称</span>
        </div>
      </router-link>

      <router-link to="/user">
        <img src="../../assets/icon/icon-user.png" alt="" class="img-user" />
      </router-link>
    </div>

    <van-tabs v-model:active="active" class="main-tabs" background="#f5f5f5" title-active-color="#ff6700">
      <van-tab title="推荐">
        <recommend></recommend>
      </van-tab>

      <van-tab title="智能">
        <intelligence></intelligence>
      </van-tab>

      <van-tab title="电视">
        <television></television>
      </van-tab>

      <van-tab title="家电">
        <household></household>
      </van-tab>

      <van-tab title="笔记本">
        <notebook></notebook>
      </van-tab>
    </van-tabs>
  </div>
</template> 

<script>
import recommend from "./components/recommend.vue";
import intelligence from "./components/intelligence.vue";
import television from "./components/television.vue";
import household from "./components/household.vue";
import notebook from "./components/notebook.vue";
export default {
  components: {
    recommend,
    intelligence,
    television,
    household,
    notebook,
  },
};
</script>

<style lang="scss" scoped >
.main-container {
  width: 100%;
  overflow: hidden;
  background-color: #f5f5f5;

  .main-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: 5px;
    .img-logo,
    .img-user {
      display: block;
    }
    .img-logo {
      width: 29px;
      height: 18px;
    }
    .img-user {
      width: 20px;
      height: 20px;
    }

    .search-box {
    width: 270px;
    height: 32px;
    background-color: #fff;
    border-radius: 2px;
    border: 1px solid #f5f5f5;
    line-height: 32px;
    color: #999;
    display: flex;
    justify-content: start;
    align-items: center;
    span {
      font-size: 14px;
    }
    i.icon-search {
        padding: 5px;
        font-size: 20px;
      }
      
  }
  }
  .main-tabs {
    background-color: #f5f5f5;
  }
  

  .img-user {
    width: 20px;
    height: 20px;
  }

  .van-tab--active {
    color: #ff6700;
  }
  
}
</style>